import request from '@/utils/request'

/**
 * 获取角色列表
 */
export const getRoleListApi = () => request({ url: '/park/sys/role' })
/**
 * 获取tree权限列表
 */
export const getTreeListApi = () => request({ url: '/park/sys/permision/all/tree' })

/**
 * 获取当前角色权限点列表
 */
export const getRoleDetailApi = (roleId) => request({ url: `/park/sys/role/${roleId}` })

/**
 * 获取角色成员列表
 */
export const getRoleUserListApi = (roleId) => request({ url: `/park/sys/roleUser/${roleId}` })

/**
 * 创建角色
 */
export const createRoleUserApi = (data) => request({ url: `/park/sys/role`, method: 'POST', data })

/**
 * 更改角色
 */
export const updateRoleApi = (data) => request({ url: `/park/sys/role`, method: 'PUT', data })

/**
 * 删除角色
 */
export const delRoleUserApi = (roleId) => request({ url: `/park/sys/role/${roleId}`, method: 'DELETE' })
